package com.example.xiaosen.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.modelcontextprotocol.client.transport.HttpClientSseClientTransport;
import io.modelcontextprotocol.spec.McpClientTransport;
import org.springframework.ai.mcp.client.autoconfigure.NamedClientMcpTransport;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Collections;
import java.util.List;

/**
 * @Author: zhouxj@ferrotec.com.cn
 * @version: v1.0
 * @Date: 2025/7/11 16:25
 * @Description: 手动配置MCP客户端
 */
@Configuration
public class McpConfiguration {

//    // 注册MCP客户端传输层端点，SpringAI会自动帮我们根据传输层配置创建MCP客户端，可以通过List<McpSyncClient> mcpSyncClients;获取同步/异步客户端
//    @Bean
//    public List<NamedClientMcpTransport> mcpClientTransport() {
//        McpClientTransport amapTransport = HttpClientSseClientTransport
//                .builder("https://mcp.amap.com")
//                .sseEndpoint("/sse?key=3b53e7b2a21859becdbff2cb5ace1e6c")
//                .objectMapper(new ObjectMapper())
//                .build();
//        return List.of(new NamedClientMcpTransport("amap", amapTransport)));
//    }

}